<!doctype html>
<html lang="zh-CH">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	{{--<meta name="viewport" content="width=device-width, initial-scale=1">--}}
	<title>央票通</title>
	<link rel="stylesheet" href="./resource/css/index.css">
	<link rel="stylesheet" href="./resource/css/user.css">
</head>
<body>
<!-- 头部 -->
@include('common.index_head')
<!-- 个人中心 -->
<div class="cont-user">
	<!-- 个人中心头部 -->
	@include('common.user_head')
	<div class="user-center">
		<div class="main">
			@include('common.user_left')
			<div class="user-container left">
				<div class="user-title user-password user-news">
					<div class="title">
						<div class="h left">消息列表</div>
					</div>
					<div class="user-box">
						<ul class="pass-ul">
							<li><a href="/user_news_list">全部</a></li>
							<li class="active"><a href="/user_news_list_">未读</a></li>
							<li><a href="/user_news_list__">已读</a></li>
						</ul>
						<div class="pass-main">
							<div class="pass-cont">
								<div class="all-check">
									<input type="checkbox" class="checkAll2"> 全选
									<a href="javascript:;" onclick="del_news()">删除</a>
									<div class="right">
										<span class="unread-num">未读<?php echo count($unread)?></span>
										<span class="all-num"> / 全部<?php echo count($all)?></span>
									</div>
								</div>
								<ul class="news-ul" id="list">
									{{$info}}
								</ul>

							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<!-- footer -->
@include('common.index_foot')

<script src="./resource/js/jquery-1.11.3.min.js"></script>
<script src="./resource/js/index.js"></script>
<script src="./resource/js/user.js"></script>
<script src="./resource/js/T.js"></script>

<script type="text/javascript">
	//	$('ul.pagination li').eq(1).addClass('active');
	$(document).delegate('.page','click',function(){
		var data = $(this).data();
		console.log(data);
		//$(this).parent().addClass('active').siblings().removeClass('active');
		T.restPost('/unread_news_page', data, function (response) {
			console.log(response.data.state);
			$("#list").html(response.data.state);
		});//
	});

	function del_news(){
		var checks = document.getElementsByName("check2");
		var n = '';
		for (var i = 0; i < checks.length; i++) {
			if (checks[i].checked)
				n += checks[i].value + ','
		}
		var num = n.substring(0, (n.length) - 1);
		var msg = "您真的确定要删除吗？";
		if (confirm(msg) == true) {
			$.ajax({
				type: "POST",
				url: "/user_news_del2",
				data: "num="+num,
				success: function(msg){
					$('#list').html(msg)
				}
			});
		}
	}

//$('.news-title').click(function(){
//	var m_id = $(this).siblings('input[type="hidden"]').val();
//	$.ajax({
//		type: "POST",
//		url: "/user_news_up",
//		data: "m_id=" + m_id,
//		success: function (msg) {
//			alert(1);
//		}
//	});
//})

</script>
</body>
</html>
